/**
 * BanBu_PhotoMoveListViewController
 * @description 本文件提供转移照片选择转移相册定制cell
 * @package
 * @author 		yinlinlin
 * @copyright
 * @version 		1.0
 * @description 本文件提供转移照片选择转移相册定制cell
 */

#import "BanBu_PhotoMoveListCell.h"

@implementation BanBu_PhotoMoveListCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        _albumImgV = [[UIImageView alloc]initWithFrame:CGRectMake(15, 10, 50, 50)];
        [self.contentView addSubview:_albumImgV];
        [_albumImgV release];
        
        _infoLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, 20, 200, 20)];
        _infoLabel.text = @"name+num";
        _infoLabel.font = [UIFont systemFontOfSize:15.0];
        [self.contentView addSubview:_infoLabel];
        [_infoLabel release];
        
        _natureLabel = [[UILabel alloc]initWithFrame:CGRectMake(80, 44, 200, 13)];
        _natureLabel.textColor = UIColorWithRGB(109, 109, 109, 1);
        _natureLabel.font = [UIFont systemFontOfSize:12.0];
        
        [self.contentView addSubview:_natureLabel];
        [_natureLabel release];
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)updatePhotoMoveListCell:(BanBu_AlbumModel *)albumModel
{
    if (albumModel)
    {
        [_albumImgV setImageWithURL:[NSURL URLWithString:albumModel.image_url] placeholderImage:[UIImage imageNamed:@"move_normal.png"] andType:0];
        _infoLabel.text = [NSString stringWithFormat:@"%@(%d)",albumModel.album_title,albumModel.numCount];
        //系统相册
        if (albumModel.album_type == ALBUM_SYSTEM)
        {
            
            if ([albumModel.album_id isEqualToString:Album_privacy])
            {
                _natureLabel.text = NSLocalizedString(@"Competence_myself", 自己可见);
                [_albumImgV setImage:[UIImage imageNamed:@"move_simi.png"]];
            }
            else
            {
                [_albumImgV setImageWithURL:[NSURL URLWithString:albumModel.image_url] placeholderImage:[UIImage imageNamed:@"move_normal.png"] andType:0];
                _natureLabel.text = NSLocalizedString(@"Competence_everyone", 所有人可见);
            }
        }
        else if (albumModel.personalbum_type == CREATE_PUBLIC)
        {
            _natureLabel.text = NSLocalizedString(@"Competence_everyone", 所有人可见);
             [_albumImgV setImageWithURL:[NSURL URLWithString:albumModel.image_url] placeholderImage:[UIImage imageNamed:@"move_normal.png"] andType:0];
        }
        else if (albumModel.personalbum_type == CREATE_PRIVATE)
        {
            _natureLabel.text = NSLocalizedString(@"Competence_myself", 自己可见);
            [_albumImgV setImage:[UIImage imageNamed:@"move_simi.png"]];
        }
        else if (albumModel.personalbum_type == CREATE_QUESSTION)
        {
            _natureLabel.text = NSLocalizedString(@"Competence_qs", 回答问题可见);
            [_albumImgV setImage:[UIImage imageNamed:@"move_jiami.png"]];
        }
        else if (albumModel.personalbum_type == CREATE_OPENGROUP)
        {
            _natureLabel.text = NSLocalizedString(@"Competence_designess", 指定人可见);
             [_albumImgV setImageWithURL:[NSURL URLWithString:albumModel.image_url] placeholderImage:[UIImage imageNamed:@"move_normal.png"] andType:0];
        }
        else
        {
            _natureLabel.text = NSLocalizedString(@"Competence_notdesigness", 指定人不可见);
             [_albumImgV setImageWithURL:[NSURL URLWithString:albumModel.image_url] placeholderImage:[UIImage imageNamed:@"move_normal.png"] andType:0];
        }
    }
    else
    {
        _infoLabel.text = NSLocalizedString(@"album_create2", 新建相册);
        _natureLabel.text = @"";
        [_albumImgV setImage:[UIImage imageNamed:@"move_add.png"]];

    }
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
